[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 ASC(SEXP) (INTEGER)

 Function
  Converts a character to it's ASCII code.

 Syntax
  ASC(sexp)

   sexp = Any string expression.

 Return Type & Value
  INTEGER
  Returns the ASCII code of the first character of sexp (1-255) or 0
  if sexp is an empty string.

 Remarks
  In other languages (such as BASIC) you can have any of the 256 possible
  ASCII codes (0-255) in a string.  In PPL you are limited to 255 codes (1-
  255) because ASCII 0 is used to terminate strings and can't appear in the
  middle of a string.  So, if you ever get a 0 returned from this function,
  it is because you passed it an empty string.

 Examples
  PRINTLN "The ASCII code for S is ",ASC("S")
  ' Convert a lowercase s to uppercase
  STRING s
  LET s = CHR(ASC("s")-ASC("a")+ASC("A"))

See Also: CHR()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson